package com.chen.spzx.cloud.user.controller;

import com.chen.spzx.cloud.entity.User;
import com.chen.spzx.cloud.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author cgj
 * @date 3/29/25 9:41 AM
 */
@RestController
@RequestMapping("/api/user")
public class UserController {
    /**
     * /api/user/selectByUserId/{userId}
     */
    @Autowired
    private UserService userService;
    @GetMapping("selectByUserId/{userId}")
    public User selectById(@PathVariable Long userId
//                          , @RequestHeader("key") String key
    ){

//        System.out.println(key);
//        try {
//            Thread.sleep(10000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
        return  userService.selectById(userId);
    }
}
